﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace Esosi.Medical.ShangHai
{
    public class MedicalCore
    {
        /// <summary>
        /// 医保接口函数
        /// </summary>
        /// <param name="StartParam">启动参数(8位字符串) ，固定为：12345678</param>
        /// <param name="MsgSend">发送的消息(512位字符串)</param>
        /// <param name="MsgRcv">返回的消息(512位字符串)</param>
        /// <returns>返回的消息</returns>
        [DllImport("SendRcv4.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
        public static extern string SendRcv4(string startMessage, string sendMessage, string returnMessage);

        [DllImport("SendRcv3.dll", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
        public static extern string SendRcv2(string startMessage, string sendMessage, byte[] returnMessage);

        //protected static string MedicalTrade(string sendMessage)
        //{
        //    var returnMessage = string.Empty;// new byte[512];
        //    var utf8 = Encoding.UTF8;

        //    byte[] utfBytes = utf8.GetBytes(sendMessage);
        //    return SendRcv4("12345678", sendMessage, returnMessage);
        //}
    }
}